﻿#region $ID$ event handlers

protected void $ID$_Init(object sender, EventArgs e)
{
    ObjectDataSource aODS = (ObjectDataSource)sender;
    
    aODS.DataObjectTypeName="$DataObjectTypeName$";
    
    aODS.TypeName="$TypeName$";
  
	aODS.SelectMethod="$SelectMethod$";
	aODS.InsertMethod="$InsertMethod$"; 
	aODS.UpdateMethod="$UpdateMethod$";
	aODS.DeleteMethod="$DeleteMethod$" ;
	aODS.SelectCountMethod="$SelectCountMethod$";
  
    aODS.EnablePaging = true;
    aODS.SelectParameters.Add("startRowIndex", TypeCode.Int32, "0");
    aODS.SelectParameters.Add("maximumRows", TypeCode.Int32, "0");

    aODS.OldValuesParameterFormatString = "original_{0}";

    aODS.Selected += new ObjectDataSourceStatusEventHandler($ID$_Selected);
}

private void $ID$_Selected(object sender, ObjectDataSourceStatusEventArgs e)
{
    if (e.Exception != null)
    {
        Log.ReportError(e.Exception.InnerException);
        e.ExceptionHandled = true;
    }
}

#endregion